import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '@/views/Login'
import Layout from '@/views/Layout'
import Category from '@/views/Category'
import Home from '@/views/Home'
import Good from '@/views/Good'
import Cart from '@/views/CartList'
import Settlement from '@/views/Settlement'
import Pay from '@/views/Pay'
import PayCallBack from '@/views/Pay/CallBack'
const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '',
        component: Home
      },
      {
        path: 'category/:id',
        component: Category
      },
      {
        path: 'good/:id',
        name: 'Good',
        component: Good
      },
      {
        path: 'cart',
        name: 'Cart',
        component: Cart
      },
      {
        path: 'settle',
        name: 'Settlement',
        component: Settlement
      },
      {
        path: 'pay',
        component: Pay
      },
      {
        path: 'pay/callback',
        component: PayCallBack
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
